<?php

class Scaffold_DefaultDb_Route extends Model3_Scaffold_Model
{

    public function __construct()
    {
        $this->_class = 'DefaultDb_Entities_Route';

        $this->_deleteLinkAllow = array(DefaultDb_Entities_User::USER_ADMIN);

        $this->_attrsRow['close'] = true;

        $this->_columns['code'] = array(
            'label' => 'Clave',
            'required' => 'required',
            'placeholder' => 'clave'
        );

        $this->_columns['name'] = array(
            'label' => 'Nombre',
            'required' => 'required',
            'placeholder' => 'nombre'
        );

        $this->_columns['factor'] = array(
            'label' => 'Factor',
            'required' => 'required',
            'placeholder' => 'factor'
        );

        $this->_columns['close'] = array(
            'label' => 'Cerrada',
            'formIgnore' => true,
            'tableIgnore' => true
        ); /// IMPORTANTE!!!

        $this->_externalActions['Puntos de venta'] = array(
            'module' => 'Admin',
            'controller' => 'Routes',
            'action' => 'points'
        );

        $this->_externalActions['Programación de rutas'] = array(
            'module' => 'Admin',
            'controller' => 'Schedule',
            'action' => 'route'
        );

        $this->_externalActions['Asignar a controlador de operaciones'] = array(
            'module' => 'Admin',
            'controller' => 'Routes',
            'action' => 'AssignOperationsController',
            'deny' => array(DefaultDb_Entities_User::USER_OPERATION_CONTROLLER),
        );

        parent::__construct();
    }

}
